<%= form_for([@project, @member]) do |f| %>
  <% if @member.errors.any? %>
    <div id="error_explanation">
      <h2><%= @member.errors.count.to_s + " " + (t :error, :scope => "helpers") %></h2>

      <ul>
      <% @member.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :user_id %>
    <% if params[:project_id] && params[:id] %>
      <%= f.label @member.user.alias %><br />
    <% elsif params[:project_id] %>
      <%= collection_select(:member, :user_id, User.where("id not in (?)", Project.find(params[:project_id]).users), :id, :alias) %><br />
    <% end %>
  </div>

  <div class="field">
    <%= f.label :role %>
    <%= f.select(:role, t("activerecord.attributes.values.member.roles").invert) %> <br />
  </div>

  <div>
    <%= f.label :status %>
    <%= f.select(:status, t("activerecord.attributes.values.member.statuses").invert) %>
  </div>

  <div class="field">
    <%= f.label :load %>
    <%= f.text_field :load, :maxlength => "3" %>
  </div>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
